# -*- coding: utf-8 -*-
# @Author : 17
# @Time    : 2024/4/24 15:23
# @File    : bug_clear_msg.py
from feishu.feishu_notice import FeiShutalkChatbot
from notice.bugs_clear_notice import get_bugs


def bug_clear_msg():

    for bug_group in get_bugs():
        for bug in bug_group:
            msg = "#### **禅道处理通知**\n 执   行   人: {0}  \n\n bug标题: {1}  \n\n 所  属  项 目: {2} " \
            "\n\n[点我查看](http://192.168.6.21:8888/zentao/bug-browse-9.html?PRJ={3})".format(bug['realName'], bug['title'],bug['name'],bug["PRJ"])
            webhook = "https://open.feishu.cn/open-apis/bot/v2/hook/917fe499-a821-4624-baec-73b85f099b04"
            feishu = FeiShutalkChatbot(webhook)
            feishu.send_text(msg)

